<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a="http://richfaces.org/a4j"
      template="/WEB-INF/templates/front/template.xhtml"> 
<ui:define name="content"> 


    
<h1 class="title">产品列表</h1>

<div class="products">
<h:form>
<ul class="productList">
<ui:repeat value="#{productManager.resultList}" var="_product">
    <li>
        <div class="productImage">
            <h:link outcome="/product.jsf">
                <f:param name="productId" value="#{_product.id}"/>
                <img src="/upload/#{_product.mainImageUrl}" width="100" height="100"/>
            </h:link>
        </div>
        <p class="productDesc">#{_product.name}</p>
        <span class="price">价格：#{_product.price}</span>
        
        <div class="orderButton">
            <a:commandButton action="#{orderManager.addToCart(_product)}" value="放入购物车" render="cart"/>
        </div>
    </li>
</ui:repeat>
</ul>
</h:form>
</div>
</ui:define>
</ui:composition>